<template id="idea">
    <div>
        <div class="idea_top">
            <h3>意见反馈</h3>
            <img src="../image/blue_da.png" alt="" @click="getIdea()">
        </div>
        <div class="idea_text">
            <div class="idea_center">
                <textarea name="" id="feedback" cols="30" rows="10" class="idea_t" placeholder="请写下你的建议或意见" maxlength="200" @input="descInput" v-model="desc">

                </textarea>
                 <span>{{remnant}}/<time>200</time></span>
                <p>每一条反馈小马都会认真对待。我们将定期选出优秀反馈意见，发送积分奖励啊</p>
                <div class="idea_ti" @click="feedback()">提交</div>
            </div>

        </div>
	
    </div>
</template>
<script>
    export default {
        name:'idea',
        data(){
            return{
                remnant:200,
                desc:'',
            }
        },
        methods:{
            descInput(){
                var txtVal = this.desc.length;
                this.remnant = 200 - txtVal;
            },
            getIdea:function(){
                window.history.go(-1)
            },
			feedback:function(){
		     
    			var content=$("#feedback").val();	
    			if(!content || content ==""){
    			     alert('请输入您的建议'); return false;
    			}	

                let url  = this.GLOBAL.BaseUrl+'/mobile/api/v1/Help.php?mode=feedback&content='+content;
                let Data = this.GLOBAL.dataParam();
                
                this.$ajax.post(url,Data).then((res) => {
                    let temp = res.data;
                    if(temp.code == 200){
                        this.GLOBAL.setCookie('idea','');
                        window.location.href = '/center?pack=idea';
                    }else{
                        this.GLOBAL.center_error(this,temp);  
                    }  
                })  

            }
			
        }
    }
</script>
<style>

    .idea_ti{
        width:5.9rem;
        height:0.74rem;
        line-height:0.74rem;
        text-align:center;
        color:#ffffff;
		background:#2eaffc;
        font-size:0.36rem;
        border-radius:0.05rem;
    }
	.idea_ti_2{
        width:5.9rem;
        height:0.74rem;
        line-height:0.74rem;
        text-align:center;
        color:#ffffff;
        background:#cccccc;
        font-size:0.36rem;
        border-radius:0.05rem;
    }
    .idea_center p{
        width:5.58rem;
        line-height:0.28rem;
        color:#4f4f4f;
        font-size:0.22rem;
        margin-bottom:0.26rem;
    }
    .idea_center span{
        position:absolute;
        color:#bcbcbc;
        font-size:0.24rem;
        left:5rem;
        top:2rem;
    }
    .idea_t{
    width:5.9rem;
     height:2.42rem;
        border:0;
        outline:none;
        background:#f3f3f3;
        line-height:0.28rem;
    }
    .idea_center{
        width:5.9rem;
        height:4.42rem;
        margin:0.22rem 0.28rem;
        position:relative;

    }
    .idea_text{
        width:100%;
        height:4.46rem;
    }
    .idea_top h3{
        width:100%;
        height:0.79rem;
        line-height:0.79rem;
        text-align:center;
        color:#2eaffc;
        font-size:0.28rem;
    }
    .idea_top img{
        display:block;
        position:absolute;
        height:0.36rem;
        width:0.36rem;
        left:0.27rem;
        top:0.25rem;
    }
    .idea_top{
        width:100%;
        height:0.79rem;
        border-bottom:0.01rem solid #f0f0f0;
        position:relative;
    }
</style>